import http from "../utils/http";
// 获取用户列表数据
let getUsersList = (data:UsersData)=>http(`users`,'GET',data);
// 添加用户
let addUsers= (data:AddUserData)=>http(`users`,'POST',data);
// 编辑用户
let updateUsers = (data:AddUserData,id:number)=>http(`users/${id}`,'PUT',data);
// 修改用户状态
let updateState = (uId:number,type:boolean)=>http(`users/${uId}/state/${type}`,'PUT')
//删除用户
let deleteUsers = (uId:number)=>http(`users/${uId}`,'DELETE');
// 分配角色
let setRoles = (id:number,rid:number)=>http(`users/${id}/role`,'PUT',{rid})
// 获取数据统计
let getReprots = ()=>http(`reports/type/1`);
export {
    getUsersList,
    addUsers,
    updateUsers,
    updateState,
    deleteUsers,
    setRoles,
    getReprots
}